<?php

/**
 * InvoiceItem form base class.
 *
 * @package    wifilez
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 16976 2009-04-04 12:47:44Z fabien $
 */
class BaseInvoiceItemForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'invoice_item_id' => new sfWidgetFormInputHidden(),
      'product_id'      => new sfWidgetFormPropelChoice(array('model' => 'Product', 'add_empty' => false)),
      'invoice_id'      => new sfWidgetFormPropelChoice(array('model' => 'Invoice', 'add_empty' => false)),
      'quantity'        => new sfWidgetFormInput(),
      'extended_price'  => new sfWidgetFormInput(),
      'shipping_status' => new sfWidgetFormDateTime(),
      'reserved'        => new sfWidgetFormInput(),
    ));

    $this->setValidators(array(
      'invoice_item_id' => new sfValidatorPropelChoice(array('model' => 'InvoiceItem', 'column' => 'invoice_item_id', 'required' => false)),
      'product_id'      => new sfValidatorPropelChoice(array('model' => 'Product', 'column' => 'product_id')),
      'invoice_id'      => new sfValidatorPropelChoice(array('model' => 'Invoice', 'column' => 'invoice_id')),
      'quantity'        => new sfValidatorInteger(),
      'extended_price'  => new sfValidatorNumber(),
      'shipping_status' => new sfValidatorDateTime(),
      'reserved'        => new sfValidatorInteger(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('invoice_item[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'InvoiceItem';
  }


}
